/*
 * @Author: HeAo
 * @Date: 2021-10-21 15:05:52
 * @LastEditTime: 2021-10-21 15:13:55
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \ej-webui\src\store\modules\proCategory.js
 * 别乱动！
 */
import request from '@/utils/request'
export default {
  namespaced: true,
  state () {
    return {
      proCategories: []
    }
  },
  mutations: {
    SET_CATEGORIES (state, payload) {
      state.proCategories = payload
    }
  },
  actions: {
    async findAllProductCategories ({ commit }) {
      let res = await request.get('/productCategory/pageQuery', {
        params: {
          page: 1,
          pageSize: 1000
        }
      })
      // 提交突变
      commit('SET_CATEGORIES', res.data.list)
    }
  }
}